package com.app.micaihu.bean.ad;

import com.app.micaihu.bean.InstallBean;
import com.app.micaihu.bean.game.IDownload;
import com.app.micaihu.custom.components.downandupload.DownloadUtils;
import com.app.utils.util.StringUtils;

import java.util.Arrays;

/**
 * 原生广告
 * Created by linkai on 2016/9/21.
 */
public class NativeAd extends InstallBean implements IDownload {

    private int adPosition;//列表索引位置
    private String adId;//广告id
    private String style;//广告样式
    private String adType;//广告类型
    private String serialId;//广告后台id


    /************ 以下属性是自定义广告的属性 *********/
    private String[] thumbList;//图片集合
    private String title;//广告标题
    private String summary;//广告描述
    private String typeDesc;//广告类型描述
    private String jumpUrl;//H5跳转链接
    private String promoteUrl;//H5地址(首次用于游戏的展示地址)
    private String publishTime;//发布时间
    private String mark;//小标
    private String appIcon;//广告logo

    private int adKey;//存入缓存的唯一key，如果key=0 则用所在的listview的item的index做为key


    private String appSize;//游戏大小
    private String articleId;//文章id
    private int status;//4的时候 已下架


    public void setStatus(int status) {
        this.status = status;
    }
    public String getAppSize() {
        return appSize;
    }

    public void setAppSize(String appSize) {
        this.appSize = appSize;
    }

    public String getArticleId() {
        return articleId;
    }

    public void setArticleId(String articleId) {
        this.articleId = articleId;
    }

    public int getAdPosition() {
        return adPosition;
    }

    public void setAdPosition(int adPosition) {
        this.adPosition = adPosition;
    }

    public String getAdId() {
        return adId;
    }

    public void setAdId(String adId) {
        this.adId = adId;
    }

    public String getStyle() {
        return style;
    }

    public void setStyle(String style) {
        this.style = style;
    }

    public String getAdType() {
        return adType;
    }

    public void setAdType(String adType) {
        this.adType = adType;
    }

    public String getPromoteUrl() {
        return promoteUrl;
    }

    public void setPromoteUrl(String promoteUrl) {
        this.promoteUrl = promoteUrl;
    }

    public String getSerialId() {
        return serialId;
    }

    public void setSerialId(String serialId) {
        this.serialId = serialId;
    }

    public String[] getThumbList() {
        return thumbList;
    }

    public void setThumbList(String[] thumbList) {
        this.thumbList = thumbList;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public String getTypeDesc() {
        return typeDesc;
    }

    public void setTypeDesc(String typeDesc) {
        this.typeDesc = typeDesc;
    }

    public String getJumpUrl() {
        return jumpUrl;
    }

    public void setJumpUrl(String jumpUrl) {
        this.jumpUrl = jumpUrl;
    }

    public int getAdKey() {
        return adKey;
    }

    public void setAdKey(int adKey) {
        this.adKey = adKey;
    }

    public String getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(String publishTime) {
        this.publishTime = publishTime;
    }

    public String getMark() {
        return mark;
    }

    public void setMark(String mark) {
        this.mark = mark;
    }

    public String getAppIcon() {
        return appIcon;
    }

    public void setAppIcon(String appIcon) {
        this.appIcon = appIcon;
    }

    @Override
    public String toString() {
        return "NativeAd{" +
                "adPosition=" + adPosition +
                ", adId='" + adId + '\'' +
                ", style='" + style + '\'' +
                ", adType='" + adType + '\'' +
                ", serialId='" + serialId + '\'' +
                ", thumbList=" + Arrays.toString(thumbList) +
                ", title='" + title + '\'' +
                ", summary='" + summary + '\'' +
                ", typeDesc='" + typeDesc + '\'' +
                ", jumpUrl='" + jumpUrl + '\'' +
                ", promoteUrl='" + promoteUrl + '\'' +
                ", publishTime='" + publishTime + '\'' +
                ", mark='" + mark + '\'' +
                ", appIcon='" + appIcon + '\'' +
                ", adKey=" + adKey +
                '}';
    }

    @Override
    public String getIUrl() {
        return getJumpUrl();
    }

    @Override
    public String getIPath() {
        return DownloadUtils.FILE_START_NAME + getPackageName();
    }

    @Override
    public String getITitle() {
        return getTitle();
    }

    @Override
    public String getIPackageName() {
        return getPackageName();
    }

    @Override
    public String getITag() {
        return StringUtils.macthUrl(getJumpUrl());
    }

    @Override
    public String getIGameSummary() {
        return getSummary();
    }

    @Override
    public String getIGameId() {
        return getAdId();
    }

    @Override
    public String getIAppIcon() {
        return getAppIcon();
    }

    @Override
    public String getISize() {
        return getAppSize();
    }

    @Override
    public int getStatus() {
        return status;
    }
}
